{extend name="public:common_index" /}

{block name="main"}
<!--body wrapper start-->
<div class="wrapper">
    <div class="row">


        <h2 style="text-align: center;font-size: xx-large; color: #65CEA7;margin-top: 50px">欢迎来到伴心后台管理系统</h2>
        <div class="row" >
            <div class="col-md-12" >
                <div class="box  box-primary">
                    <div class="box-body">
                        <div class="info-box">
                            <table class="table table-bordered" width="60%">
                                <tbody>
                                <tr>
                                    <td>服务器操作系统：</td>
                                    <td>{$sys_info.os}</td>
                                    <td>服务器域名/IP：</td>
                                    <td>{$sys_info.domain} [ {$sys_info.ip} ]</td>
                                </tr>
                                <tr>
                                    <td>服务器环境：</td>
                                    <td>{$sys_info.web_server}</td>
                                    <td>PHP 版本：</td>
                                    <td>{$sys_info.phpv}</td>
                                </tr>
                                <tr>
                                    <td>Mysql 版本：</td>
                                    <td>{$sys_info.mysql_version}</td>
                                    <td>GD 版本</td>
                                    <td>{$sys_info.gdinfo}</td>
                                </tr>
                                <tr>
                                    <td>文件上传限制：</td>
                                    <td>{$sys_info.fileupload}</td>
                                    <td>最大占用内存：</td>
                                    <td>{$sys_info.memory_limit}</td>
                                </tr>
                                <tr>
                                    <td>最大执行时间：</td>
                                    <td>{$sys_info.max_ex_time}</td>
                                    <td>安全模式：</td>
                                    <td>{$sys_info.safe_mode}</td>
                                </tr>
                                <tr>
                                    <td>Zlib支持：</td>
                                    <td>{$sys_info.zlib}</td>
                                    <td>Curl支持：</td>
                                    <td>{$sys_info.curl}</td>
                                </tr>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="row">


        <h2 style="text-align: center;font-size: xx-large; color: #65CEA7;">平台待处理业务</h2>
        <div class="row" >
            <div class="col-md-12" >
                <div class="box  box-primary">
                    <div class="box-body">
                        <div class="info-box">
                            <table class="table table-bordered" width="60%">
                                <tbody>
                                <tr>
                                    <td>订单申诉：</td>
                                    <td><a href="{:url('skill/protest')}" id="protest">{$works.protest}</a></td>
                                    <td>实名认证：</td>
                                    <td><a href="{:url('user_check/index')}?type=3" id="check">{$works.check}</a></td>
                                </tr>
                                <tr>
                                    <td>用户举报：</td>
                                    <td><a href="{:url('report/user')}?status=0" id="report_user">{$works.report_user}</a></td>
                                    <td>动态审核：</td>
                                    <td><a href="{:url('vod/index')}?status=2" id="vod">{$works.vod}</a></td>
                                </tr>
                                <tr>
                                    <td>房间举报：</td>
                                    <td><a href="{:url('report/index')}?status=0" id="report_room">{$works.report_room}</a></td>
                                    <td>技能申请：</td>
                                    <td><a href="{:url('skill/apply')}?status=0" id="skill">{$works.skill}</a></td>
                                </tr>
                                <tr>
                                    <td>提现申请：</td>
                                    <td><a href="{:url('money/cash')}" id="cash">{$works.cash}</a></td>
                                    <td>账号审核：</td>
                                    <td><a href="{:url('money/account')}?status=2" id="account">{$works.account}</a></td>
                                </tr>
                                <tr>
                                    <td>修改审核：</td>
                                    <td><a href="{:url('user/check')}?status=2" id="change">{$works.change}</a></td>
                                    <td>手势认证：</td>
                                    <td><a href="{:url('user_check/img')}" id="img">{$works.img}</a></td>
                                </tr>
                                <tr>
                                    <td>Zlib支持：</td>
                                    <td>{$sys_info.zlib}</td>
                                    <td>Curl支持：</td>
                                    <td>{$sys_info.curl}</td>
                                </tr>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<audio id="audio" src="" autoplay="autoplay" />
<script>

    var t1= window.setInterval(refreshCount,5000);

    var obj = {:json_encode($works)};

    var src = "__PUBLIC__/9411.wav";


    function refreshCount() {
        $.ajax({
            url: "{:url('getworks')}",
            type:'get',
            success: function (data) {
                if (data.code == 1){
                    $.each(data.data,function (k,v) {

                        if (obj[k] != v && v > 0){
                            obj[k] = v;
                            $("#"+k).html(v);

                            $('#audio').attr('src',src);
                            $('#audio').play();
                        }else{
                            obj[k] = v;
                            $("#"+k).html(v);
                        }
                    });
                    // $('#audio').attr('src','');
                }
            },
        });
    }


    /**video.play()返回一个promise，未禁止则resolve，禁止则reject**/
    // let video = document.getElementById("video");
    // let audio = document.getElementById("audio");
    // let videoPlay = video.play();
    // let audioPlay = audio.play();
    //
    // videoPlay.then(()=>{
    //     console.log('可以自动播放');
    // }).catch((err)=>{
    //     console.log(err);
    //     console.log("不允许自动播放");
    //
    //     //视频元素可以选择静音后再播放,提示用户打开声音
    //     video.muted=true;
    //     video.play();
    //
    //     //也可以在用户交互后调用.play()
    //     // ...
    // });
    //
    // audioPlay.then(()=>{
    //     console.log('可以自动播放');
    // }).catch((err)=>{
    //     console.log(err);
    //     console.log("不允许自动播放");
    //
    //     //音频元素只在用户交互后调用.play(),
    //     // ...
    // });
</script>

<!--body wrapper end-->
{/block}
